/**********************************************************************
* File: map.h
* ID  : 
* Purpose: Delcare the prototype for class Map.
* Date   : 2004/04/23
* Author : T.S.Yo
* Description:
*    The class Map contains a ordered list of locations 
**********************************************************************/

#ifndef MAP_H
#define MAP_H

#include <string>
#include "ordlist.cpp"
#include "location.cpp"

class ifEngine;

class Map
{
    public:
    // Constructor
        Map();
        
    // Destructor
        ~Map();
         
    // Get Data of certain location
       int getExit(const int &locationID, const char &direction);
       int getPoint(const int &locationID);
       bool getAccessed(const int &locationID);
       string getName(const int &locationID);
       string getSDescr(const int &locationID);
       string getLDescr(const int &locationID);
       void showItemList(const int &locationID);
    // Get the exit in certain direction of given location 
        int checkExit (const int &locationID,
                       const char &direction);
    // Check if given item is in given location 
        bool checkItem(const int &locationID,
                       const string &itemName, Item &searchItem);

    // Set Data of certain location
       void setID(const int &locationID,const int &newID);
       void setExit(const int &locationID,
                    const int &newExit, const char &direction);
       void setName(const int &locationID,const string &newName);
       void setAccessed(const int &locationID,const bool &newAccessed);
       void setPoint(const int &locationID,const int &newPoint);
       void setSDescr(const int &locationID,const string &newSDescr);
       void setLDescr(const int &locationID,const string &newLDescr);
       void addItem(const int &locationID, const Item &newItem);
       void dropItem(const int &locationID,const string &itemName);

    // Access locations
       void addLoc (Location &newLocation);
       
    private:
        OrdList<Location> locations;
        
};
        
#endif    //#ifndef MAP_H


